/**
 * 
 */
package com.ubo.java.model.methode;

import java.util.Set;


import com.ubo.java.model.EVisibility;
import com.ubo.java.model.IType;
import com.ubo.java.model.comment.Comment;
import com.ubo.java.model.declaration.Parameter;
import com.ubo.transform.java.IJavaGenerable;

/**
 * @author saludegu
 * 
 */
public abstract class ASignature implements IJavaGenerable {

	/**
	 * Nom de la méthode.
	 */
	protected final IType mType;

	/**
	 * Visibilité de la méthode.
	 */
	protected final EVisibility mVisibility;
	/**
	 * Liste des parametres.
	 */
	protected Set<Parameter> mParameterList;

	/**
	 * Commentaire de la signature.
	 */
	protected Comment mComment;

	/**
	 * Constructor
	 * 
	 */
	public ASignature(EVisibility visibility, Set<Parameter> parameters,
			IType type) {
		mVisibility = visibility;
		mParameterList = parameters;
		mType = type;
	}

	/**
	 * Ajout des commentaires de paramètres.
	 */
	protected void generateComments() {
		if (mParameterList != null && mParameterList.size() > 0) {
			for (Parameter param : mParameterList) {
				mComment.addParameter(param.getName());
			}
		}
	}

	/**
	 * Getter du commentaire de la signature.
	 * 
	 * @return
	 */
	public Comment getComment() {
		return mComment;
	}

	/**
	 * @return the mVisibility
	 */
	public EVisibility getVisibility() {
		return mVisibility;
	}

	/**
	 * @return the mParameterList
	 */
	public Set<Parameter> getParameterList() {
		return mParameterList;
	}

	/**
	 * @return the mType
	 */
	public IType getType() {
		return mType;
	}
}